package com.shensi.api.admin.client.fleet;

import com.shensi.api.admin.client.fallback.fleet.FleetRechargeDetailClientFallBack;
import com.shensi.api.admin.domian.device.dto.FleetRechargeDetailDto;
import com.shensi.api.admin.domian.device.vo.FleetRechargeDetailVo;
import com.shensi.common.core.constant.CloudConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;


/**
 * @author mao
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = FleetRechargeDetailClientFallBack.class)
@Component
public interface FleetReChargeDetailClient {

    /**
     * 根据ID获取车队充值明细
     */
    @GetMapping("/fleet/recharge_details/FleetRechargeDetailById/{id}")
    public ResponseEntity<FleetRechargeDetailVo> getFleetRechargeDetailById(@PathVariable("id") Integer id);

    /**
     * 添加车队充值明细
     */
    @PostMapping("/fleet/recharge_details")
    public ResponseEntity<FleetRechargeDetailVo> addFleetRechargeDetail(@RequestBody FleetRechargeDetailDto fleetRechargeDetail);

    /**
     * 更新车队充值明细
     */
    @PutMapping("/fleet/recharge_details/FleetRechargeDetailById/{id}")
    public ResponseEntity<Void> updateFleetRechargeDetail(@PathVariable("id") Integer id, @RequestBody FleetRechargeDetailDto fleetRechargeDetail);

    /**
     * 根据ID删除车队充值明细
     */
    @DeleteMapping("/fleet/recharge_details/DeleteFleetRechargeDetailById/{id}")
    public ResponseEntity<Void> deleteFleetRechargeDetailById(@PathVariable("id") Integer id);
}
